#【练习】词频统计
"""编写一个Python程序，来计算给定文本中每个单词出现的次数"""

txt="My name is lihua, I like playing computer games."
words=txt.lower().split()
word_count={}
for word in words:
    word=word.strip(",.")
    if word in word_count:
        word_count[word]+=1
    else:
        word_count[word]=1
for word,count in word_count.items():
    print(f"单词：{word},次数:{count}")